package com.tul.exercise.base.jmockit.mockpublicmethod;

import com.tul.exercise.base.jmockit.mockpublicmethod.conponent.Demo1DAOImpl;
import com.tul.exercise.base.jmockit.mockpublicmethod.conponent.Demo1ServiceImpl;
import com.tul.exercise.base.jmockit.mockpublicmethod.itf.Demo1DAO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * spring 配置类
 */
// spring的基于java的配置时，配置类需要同时有@Configuration、@ComponentScan注解
@Configuration
@ComponentScan(basePackages = "com.tul.exercise.base.jmockit.mockpublicmethod.conponent")
public class SpringConfig {

    @Bean(name="demo1Service")
    public Demo1ServiceImpl demo1Service(){
        return  new Demo1ServiceImpl();
    }

    @Bean(name = "demo1DAO")
    public Demo1DAO demo1DAO() {
        return  new Demo1DAOImpl();
    }
}
